/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ARK_WEB_PRINT_DOCUMENT_ADAPTER_ADAPTER_IMPL_H_
#define ARK_WEB_PRINT_DOCUMENT_ADAPTER_ADAPTER_IMPL_H_
#pragma once

#include "ohos_nweb/include/ark_web_print_document_adapter_adapter.h"
#include "ohos_nweb/include/ark_web_print_write_result_callback_adapter.h"
#include "ohos_nweb/include/ark_web_print_attributes_adapter.h"
#include "include/nweb_print_manager_adapter.h"

namespace OHOS::ArkWeb {

class ArkWebPrintDocumentAdapterAdapterImpl : public ArkWebPrintDocumentAdapterAdapter {
public:
    explicit ArkWebPrintDocumentAdapterAdapterImpl(std::unique_ptr<OHOS::NWeb::NWebPrintDocumentAdapterAdapter> ref);

    void OnStartLayoutWrite(const ArkWebString& jobId, ArkWebRefPtr<ArkWebPrintAttributesAdapter> oldAttrs,
        ArkWebRefPtr<ArkWebPrintAttributesAdapter> newAttrs, uint32_t fd,
        ArkWebRefPtr<ArkWebPrintWriteResultCallbackAdapter> callback) override;

    void OnJobStateChanged(const ArkWebString& jobId, uint32_t state) override;

private:
    std::unique_ptr<OHOS::NWeb::NWebPrintDocumentAdapterAdapter> ref_;

    IMPLEMENT_REFCOUNTING(ArkWebPrintDocumentAdapterAdapterImpl);
};

} // namespace OHOS::ArkWeb

#endif // ARK_WEB_PRINT_DOCUMENT_ADAPTER_ADAPTER_IMPL_H_